/**
 * @Author: lusx
 * @Date:   19-03-2019 01:43:38
 * @Project: Govern督办
 * @Last modified by:   lusx
 * @Last modified time: 27-09-2019 03:14:10
 */
import React from 'react';
import { withRouter, NavLink } from 'react-router-dom';
import { Tools, Flex } from 'weaver-mobile';
const getLabel = Tools.getLabel;
//重写长列表的行
@withRouter
export default class ComListItem extends React.Component {
  static defaultProps = {
    prefixCls: 'govern-list',
  }
  render() {
    const { data, match, prefixCls="",isshare } = this.props;
    const { id, randomFieldId } = data;
    return isshare =='1'?(
      <div className="g-comListItem" key={id || randomFieldId}>
            {/* <NavLink
              to={{
                pathname: `${match.url}/info/content`,
                search: `?id=${id}`,
                state: { 'namespan': mobileNamespan }
              }}
              exact
              activeClassName="active"
            >
              <div className='namespan' style={dataidspan === '1' ? { color: '#868686' } : null}>{`${mobileNamespan.length > 0 ? mobileNamespan : getLabel("140", "未设置标题")}`}</div>
              <div className='responsiblespan'>{getLabel("120", "责任人")}:{mobileResponsiblespan}</div>
              <div className='enddate'>{getLabel("130", "计划结束日期")}:{mobileEnddatespan}</div>
            </NavLink> */}
            {this.props.render(`${match.url}/info/content`)}
          <div className={`${prefixCls}-more`}>
            {this.props.children}
          </div>
      </div>
    ):(
      <div className="g-comListItem" key={id || randomFieldId}>
        <Flex justify="between">
          <div className={`${prefixCls}-link`}>
            {/* <NavLink
              to={{
                pathname: `${match.url}/info/content`,
                search: `?id=${id}`,
                state: { 'namespan': mobileNamespan }
              }}
              exact
              activeClassName="active"
            >
              <div className='namespan' style={dataidspan === '1' ? { color: '#868686' } : null}>{`${mobileNamespan.length > 0 ? mobileNamespan : getLabel("140", "未设置标题")}`}</div>
              <div className='responsiblespan'>{getLabel("120", "责任人")}:{mobileResponsiblespan}</div>
              <div className='enddate'>{getLabel("130", "计划结束日期")}:{mobileEnddatespan}</div>
            </NavLink> */}
            {this.props.render(`${match.url}/info/content`)}
          </div>
          <div className={`${prefixCls}-more`}>
            {this.props.children}
          </div>
        </Flex>
      </div>
    )
  }
}
